/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright  2006 Joram Querner
| http://www.have-fun.nl
| Mail: joram@have-fun.nl
+----------------------------------------------------*/

INSTALATION
-------------------------
1. Upload the infusion file to your server
2. WARNING! if you ever have modified the maincore.php file do not upload this one
3. go to the admin panel and infuse the infusion
4. if you have upload the maincore.php you are finished else go on...

5. find in maincore.php:
// Parse smiley bbcode into HTML images
function parsesmileys($message) {
        $smiley = array(
                "#\:\)#si" => "<img src='".IMAGES."smiley/smile.gif' alt='smiley'>",
                "#\;\)#si" => "<img src='".IMAGES."smiley/wink.gif' alt='smiley'>",
                "#\:\(#si" => "<img src='".IMAGES."smiley/sad.gif' alt='smiley'>",
                "#\:\|#si" => "<img src='".IMAGES."smiley/frown.gif' alt='smiley'>",
                "#\:o#si" => "<img src='".IMAGES."smiley/shock.gif' alt='smiley'>",
                "#\:p#si" => "<img src='".IMAGES."smiley/pfft.gif' alt='smiley'>",
                "#b\)#si" => "<img src='".IMAGES."smiley/cool.gif' alt='smiley'>",
                "#\:d#si" => "<img src='".IMAGES."smiley/grin.gif' alt='smiley'>",
                "#\:@#si" => "<img src='".IMAGES."smiley/angry.gif' alt='smiley'>"
        );
        foreach($smiley as $key=>$smiley_img) $message = preg_replace($key, $smiley_img, $message);
        return $message;
}

// Show smiley icons in comments, forum and other post pages
function displaysmileys($textarea) {
        $smiles = "";
        $smileys = array (
                ":)" => "smile.gif",
                ";)" => "wink.gif",
                ":|" => "frown.gif",
                ":(" => "sad.gif",
                ":o" => "shock.gif",
                ":p" => "pfft.gif",
                "B)" => "cool.gif",
                ":D" => "grin.gif",
                ":@" => "angry.gif"
        );
        foreach($smileys as $key=>$smiley) $smiles .= "<img src='".IMAGES."smiley/$smiley' onClick=\"insertText('$textarea', '$key');\">\n";
        return $smiles;
}

REAPLACE:
// Parse smiley bbcode into HTML images
function parsesmileys($message) {

$query = mysql_query("select * from ".DB_PREFIX."smilies") or die(mysql_error());
while($row = mysql_fetch_object($query)){

$img="<img src=".IMAGES."smiley/".$row->smile_url.">";

$message =str_replace($row->code,$img,$message);
}
        return $message;
}

// Show smiley icons in comments, forum and other post pages
function displaysmileys($textarea) {

$querya = mysql_query("select * from ".DB_PREFIX."smilies WHERE view='1'") or die(mysql_error());
while($rowa = mysql_fetch_object($querya)){

$smiles="$smiles <img src='".IMAGES."smiley/$rowa->smile_url' onClick=\"insertText('$textarea', '$rowa->code');\">\n";
}
        return $smiles;
}


HOW DOES IT WORK
-------------------
1. the original smilies are allready included
2. if you want a new smilie you first have to upload the image
3. you can use two codes for one smily by simpely make not visible under the text box by leaving the
   checkbox empy

